<?php

/**
 * This is the model class for table "jumlahpengadilanumur".
 *
 * The followings are the available columns in table 'jumlahpengadilanumur':
 * @property integer $jpu_id
 * @property string $jpu_kelompok
 * @property integer $jpu_jumlah_perkara
 * @property integer $jpu_terdakwa_laki
 * @property integer $jpu_terdakwa_perempuan
 * @property integer $jpu_terdakwa
 * @property integer $jpu_tahun
 */
class Jumlahpengadilanumur extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahpengadilanumur the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahpengadilanumur';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jpu_jumlah_perkara, jpu_terdakwa_laki, jpu_terdakwa_perempuan, jpu_terdakwa, jpu_tahun', 'numerical', 'integerOnly'=>true),
			array('jpu_kelompok', 'length', 'max'=>128),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jpu_id, jpu_kelompok, jpu_jumlah_perkara, jpu_terdakwa_laki, jpu_terdakwa_perempuan, jpu_terdakwa, jpu_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jpu_id' => 'Jpu',
			'jpu_kelompok' => 'Jpu Kelompok',
			'jpu_jumlah_perkara' => 'Jpu Jumlah Perkara',
			'jpu_terdakwa_laki' => 'Jpu Terdakwa Laki',
			'jpu_terdakwa_perempuan' => 'Jpu Terdakwa Perempuan',
			'jpu_terdakwa' => 'Jpu Terdakwa',
			'jpu_tahun' => 'Jpu Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jpu_id',$this->jpu_id);
		$criteria->compare('jpu_kelompok',$this->jpu_kelompok,true);
		$criteria->compare('jpu_jumlah_perkara',$this->jpu_jumlah_perkara);
		$criteria->compare('jpu_terdakwa_laki',$this->jpu_terdakwa_laki);
		$criteria->compare('jpu_terdakwa_perempuan',$this->jpu_terdakwa_perempuan);
		$criteria->compare('jpu_terdakwa',$this->jpu_terdakwa);
		$criteria->compare('jpu_tahun',$this->jpu_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}